<template>
	<div class="conPpageBox">
		<div class="promo-name-header">
			<div class="back" @click="goBack">
				<img src="../../assets/images/fanhuijiantou.png" alt="">
			</div>
			<h2>{{activityDetalis.title}}</h2>
			<p class="promo-period">{{$t('indexTitle.title224')}}
				{{activityDetalis.start_at}}~{{activityDetalis.end_at}}
			</p>
		</div>
		<div class="body">
			<div class="" v-html="activityDetalis.content">

			</div>
			<div class="dafadTime">
				{{activityDetalis.created_at}}
			</div>
		</div>
		<!-- <div class="footer">
			<div class="apply-btn">申请此优惠</div>
		</div> -->
		<!-- <div class="buttons">
			<img src="../../assets/images/xiaoxi.png" alt="" />
		</div> -->
		<loadingFour :msgText="msgTextTow" v-if="isShowLoadingTeow" @closeGuanbiTow="closeGuanbi"></loadingFour>
	</div>
</template>

<script>
	import {
		activityDetail
	} from "../../utils/api.js"
	import loadingFour from '../../components/loadingFour.vue';
	export default {
		data() {
			return {
				activityDetalis: {},
				id: "",
				baseURL: process.env.VUE_APP_URL,
				msgTextTow: "",
				isShowLoadingTeow: false
			}
		},
		components: {
			loadingFour
		},
		created() {},
		mounted() {
			this.id = this.$route.query.id;
			this.getActivityDetail()
		},
		methods: {
			closeGuanbi(e) {
				this.isShowLoadingTeow = false;
			},
			getActivityDetail() {
				let that = this;
				let data = {
					id: this.id
				}
				activityDetail(data).then((res) => {
					if (res.status.errorCode == 0) {
						console.log(res.data);
						this.activityDetalis = res.data;
					} else {
						// this.$message.error(res.status.msg);
						this.msgTextTow = res.status.msg;
						this.isShowLoadingTeow = true;
							setTimeout(()=>{
								this.isShowLoadingTeow = false;
							},2000)
						// this.$message({
						// 	showClose: true,
						// 	message: res.status.msg,
						// 	type: 'error'
						// });
					}
				}).catch((err) => {
					console.log(err, 'err')
				});
			},
			goBack() {
				this.$router.go(-1)
			}
		}
	}
</script>

<style scoped>
	* {
		box-sizing: border-box;
		margin: 0;
		padding: 0;
	}
	.conPpageBox{
		height: 90vh;
		padding-bottom: calc(50px + env(safe-area-inset-bottom));
		overflow-y: auto;
		overflow-x: hidden;
		padding-top: calc(constant(safe-area-inset-top) + 0px);
		padding-top: calc(env(safe-area-inset-top) + 0px);
		padding-bottom: calc(constant(safe-area-inset-bottom) + 85px);
		padding-bottom: calc(env(safe-area-inset-bottom) + 85px);
		box-sizing: border-box;
		position: fixed;
		z-index: 1;
		-webkit-overflow-scrolling: touch;
		width: 100%;
	}

	.promo-name-header {
		background: #fff;
		border-bottom: 1px solid #ececec;
		color: #545658;
		height: 75px;
		left: 0;
		padding: 0 10px;
		position: fixed;
		top: 0;
		z-index: 99;
		width: 100%;
	}

	.back {
		color: rgba(84, 86, 88, .7);
	}

	.back img {
		width: 26px;
		height: 26px;
	}

	h2 {
		font-size: 19px;
		height: 25px;
		line-height: 25px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.promo-period {
		font-size: 12px;
	}

	.body {
		height: calc(var(--window-inner-height) - 135px);
		background-color: #f9f9f9;
		color: #545658;
		overflow: auto;
		padding: 75px 10px 5px;
	/* 	position: absolute;
		top: 75px; */
		width: 100%;
	}

	.footer {
		background: #fff;
		border-top: 1px solid #ececec;
		bottom: 0;
		left: 0;
		padding: 10px;
		position: fixed;
		width: 100vw;
	}

	.apply-btn {
		background-color: #7240ff;
		border: none;
		border-radius: 3px;
		color: #fff;
		cursor: pointer;
		font-size: 16px;
		font-stretch: normal;
		font-style: normal;
		font-weight: 300;
		height: 44px;
		width: 100%;
		text-align: center;
		line-height: 44px;
	}

	.buttons {
		position: fixed;
		bottom: 10%;
		right: 10px;
		background-color: #99D2E3;
		width: 60px;
		height: 60px;
		border-radius: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.buttons img {
		width: 32px;
		height: 32px;
	}

	.dafadTime {
		width: 100%;
		text-align: right;
		font-size: 12px;
		color: #545658;
	}
</style>